//
//  MCHealthManager.h
//  MoveVirtualCurrency
//
//  Created by LiuYing on 2018/6/6.
//  Copyright © 2018年 Test. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "MCStepItem.h"

NS_ASSUME_NONNULL_BEGIN

typedef NS_ENUM(NSInteger, MCHealthQuery) {
    MCHealthQuerySetupError   = -1,    // 查询步数错误
};

typedef NS_ENUM(NSInteger, MCHealthResultSort) {
    MCHealthResultSortObverse   = 9,   // 正序 （过去到现在）
    MCHealthResultSortReverse          // 倒序  (现在到过去)
};

typedef NS_ENUM(NSInteger, MCHealthQueryType) {
    MCHealthQueryTypeToday   = 9,       // 读取今日步数
    MCHealthQueryTypeLastSevenDays,     // 最近七天
    MCHealthQueryTypeLastThirtyDays,    // 最近三十天
};

typedef void(^MCHealthReadBlock)(NSInteger stepCount, NSError * _Nullable error);

typedef void(^MCHealthReadResults)(NSArray <MCStepItem *> * _Nullable steps,
                                   NSError * _Nullable error);

@interface MCHealthManager : NSObject

+ (instancetype)defaultManager;

/**
 *  @brief 读取今日运动数据
 *
 **/
- (void)readTodayStepCount:(MCHealthReadBlock)result;

/**
 *  @brief 读取最近七天运动数据
 *
 **/
- (void)readLastSevenDaysStepCount:(MCHealthReadResults)results;

/**
 *  @brief 读取最近三十天运动数据
 *
 **/
- (void)readLastThirtyDaysStepCount:(MCHealthReadResults)results;

/**
 *  @brief 读取步数
 *
 **/
- (void)readStepsWithQueryType:(MCHealthQueryType)queryType
                          sort:(MCHealthResultSort)sort
                       results:(MCHealthReadResults)results;

@end

NS_ASSUME_NONNULL_END
